    package com.ivan.service.impl;

    import com.ivan.dao.UserMapper;
    import com.ivan.entity.User;
    import com.ivan.service.UserService;
    import com.ivan.utils.Page;
    import org.apache.ibatis.session.SqlSession;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;

    import java.util.List;

    /**
     * Created with IntelliJ IDEA.
     * User: ivan
     * Date: 12-7-20
     * Time: 下午6:21
     * To change this template use File | Settings | File Templates.
     */
    @Service
    public class UserServiceImpl implements UserService {
        @Autowired
        private UserMapper userMapper;
        @Autowired
        private SqlSession sqlSession;


        @Override
        public Page<User> listUsers(Page<User> userPage) {
            List<User> users = userMapper.listUsers();
//            List<User> users = sqlSession.selectList("com.ivan.dao.UserDAO.listUsers");
            userPage.setRows(users);
            return userPage;
        }
    }
